<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改需求列')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-requirement-edit" th:object="${requirement}">
            <input name="reqId" th:field="*{reqId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求分类：</label>
                <div class="col-sm-8">
                    <select name="reqType" class="form-control m-b" th:with="type=${@dict.getType('sys_req_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{reqType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">优先级：</label>
                <div class="col-sm-8">
                    <select name="reqPri" class="form-control m-b" th:with="type=${@dict.getType('sys_req_pri')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{reqPri}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">需求内容：</label>
                <div class="col-sm-8">
                    <textarea name="reqContent" class="form-control">[[*{reqContent}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">计划工作量：</label>
                <div class="col-sm-8">
                    <input name="planDays" id="planDays" th:field="*{planDays}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/requirement";
        $("#form-requirement-edit").validate({
            focusCleanup: true,
            rules:{
                planDays:"required"
            },
            messages:{
                planDays:"请输入计划工作量"
            }
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-requirement-edit').serialize());
            }
        }

        $("input[name='beginTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true,
            endDate:new Date()
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>